import { PreviewSystemProvider } from '../file-system';
import { Configs } from './config';

/**
 * 全局参数
 *
 * @author chitanda
 * @date 2022-01-18 11:01:16
 * @export
 * @class Global
 */
export class Global {
  /**
   * vscode 配置
   *
   * @author chitanda
   * @date 2022-01-18 18:01:23
   */
  readonly config = new Configs();
  /**
   * 预览文件系统
   *
   * @author chitanda
   * @date 2022-01-18 11:01:22
   * @protected
   * @type {PreviewSystemProvider}
   */
  protected _fs!: PreviewSystemProvider;
  get fs(): PreviewSystemProvider {
    return this._fs;
  }

  /**
   * 设置预览文件系统
   *
   * @author chitanda
   * @date 2022-01-18 11:01:35
   * @param {PreviewSystemProvider} fs
   */
  setFs(fs: PreviewSystemProvider) {
    this._fs = fs;
  }
}
// 全局参数
export const ctx = new Global();
